import observe from "./observe";
import Watcher from './Watcher';

const obj = {
    a: {
        x: 1,
        y: {
            m: 2
        }
    },
    b: [1, 2, 3, 4]
}

observe(obj);

new Watcher(obj, 'a.y.m', (newValue, oldValue) => {
    console.log(newValue, oldValue);
});

new Watcher(obj, 'b', (newValue, oldValue) => {
    console.log(newValue, oldValue);
});

obj.a.y.m = 3
// obj.b.push(5);

obj.b.push(5);
// console.log(obj.b);




